package com.httptcp;

import java.net.ServerSocket;
import java.net.Socket;

public class HttpService {
    public static void main(String[] args) {
        System.out.println("HTTP服务器启动...");
        // 创建http服务器
        try {
            ServerSocket serverSocket = new ServerSocket(8080);
            while (true) {
                Socket socket = serverSocket.accept();
                new HttpThread(socket).start();
                System.out.println("有浏览器请求来了...");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
